package net.stogi.unicore.beyond.ui.client.taskeditor.propertyeditor;

import net.stogi.unicore.beyond.api.model.PropertyValue;

import com.google.gwt.event.shared.GwtEvent;

public class OpenPropertyEditorEvent extends GwtEvent<OpenPropertyEditorHandler> {

	public static final GwtEvent.Type<OpenPropertyEditorHandler> TYPE = new GwtEvent.Type<OpenPropertyEditorHandler>();

	private PropertyValue property;

	public OpenPropertyEditorEvent(PropertyValue property) {
		this.property = property;
	}

	@SuppressWarnings("unused")
	private OpenPropertyEditorEvent() {}

	@Override
	public Type<OpenPropertyEditorHandler> getAssociatedType() {
		return TYPE;
	}

	public PropertyValue getProperty() {
		return property;
	}

	public void setProperty(PropertyValue propertyValue) {
		this.property = propertyValue;
	}

	@Override
	protected void dispatch(OpenPropertyEditorHandler handler) {
		handler.onOpenPropertyEditor(this);
	}
}
